package com.oasys.enums;

import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;

/**
 * @author mis_wu
 * @描述 自定义响应状态码枚举
 * code
 * msg
 **/
@AllArgsConstructor
@NoArgsConstructor
public enum OaResponseCode {
    /**
     * 成功
     */
    SUCCESS(200, "success",null),
    /**
     * 失败
     */
    FAIL(300, "fail",null),
    /**
     * 404
     */
    NOT_FOUND(404, "未找到该资源！",null),
    /**
     * 500 服务器错误
     */
    INTERNAL_SERVER_ERROR(500, "服务器内部错误！",null),
    /**
     * 未登录
     */
    USER_NOT_LOGIN(501,"未登录或登录信息过期,请重新登录!!!"),
    ROLE_MENU_EXIST(10001,"该角色已经存在该菜单,请勿重复添加!!!"),
    ROLE_MENU_ADD_FAIL(10002,"角色添加菜单失败!!!"),
    ROLE_MENU_ADD_SUCCESS(10003,"角色添加菜单成功!!!")
    ;

    private int code;
    private String msg;
    private Object data;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    OaResponseCode(Integer code, String msg){
        this.code=code;
        this.msg=msg;
    }

    OaResponseCode(Integer code, Object data){
        this.code=code;
        this.data=data;
    }
}

